package cn.bkrc.RedisTest;
import cn.bkrc.redis.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import javax.annotation.Resource;
import java.util.Set;

@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest
public class RedisZSetTest {

    @Resource
    private RedisZSetUtils redisZSetUtils;


    @Test
    public void add(){
       redisZSetUtils.add("courses","redis",0);
       redisZSetUtils.add("courses","mysql",1);
   }

    @Test
    public void range(){
        Set<Object> courses=redisZSetUtils.range("courses",0,5);
        for(Object o:courses){
            System.out.println(o);
        }
    }

    @Test
    public void remove(){
        redisZSetUtils.remove("courses","redis");
    }

}
